<?php

/**
 * news components.
 *
 * @package    cpfaizenay
 * @subpackage news
 * @author     Manu
 * @version    1.0
 */
class newsComponents extends sfComponents
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeHomeShow(sfWebRequest $request) {

     $this->news_list = Doctrine::getTable('News')->getNews($this->id_category, $this->kindNews, sfConfig::get('app_news_max_news_on_homepage'))->execute(array(),Doctrine::HYDRATE_ARRAY);
//    $this->news_categories = Doctrine::getTable('Category')->getNewsCategories()->execute();
  }

  public function executeListNews(sfWebRequest $request) {
      $this->newsListByCategory = Doctrine::getTable('News')->getNews($this->idCurrentCategory, null, sfConfig::get('app_news_max_news_on_detail'))->execute(array(),Doctrine::HYDRATE_ARRAY);
  }

}
